Skip to content

fix(audio): recognize individual propagation path import - #1947

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
oguzhanozfe:fix/audio-propagation-singular-path
Oct 10, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
oguzhanozfe:fix/audio-propagation-singular-path

Conversation

@oguzhanozfe

Copy link
Copy Markdown
Contributor

What

SAROS imports tKSmk2JsMAA from libSceAudioPropagation, but the library only declares the plural sceAudioPropagationSourceSetAudioPaths. Eager import resolution therefore fails before the executable starts.

Declare the distinct singular sceAudioPropagationSourceSetAudioPath(uint64_t path, const void* data, float gain). Its signature follows the pinned public SharpProspero declaration linked in TechnicalDebt. Invocation calls the standard named unsupported-function helper and throws without reading or writing caller memory. Successful path updates remain unsupported; allocation, ownership, rendering and console error codes remain unknown.

Extend guest_audio_propagation with sentinel-memory preservation and null-input refusal checks. Existing zero-path behavior remains unchanged.

Tested

Windows x86-64, WinLibs GCC 15.2.0, Release, current main at f145139676a48306681d3a4d5fabf83938759daf.

  • Canonical full-library CMake configuration with BUILD_TESTING=ON; built nid_patcher, guest_audio_propagation_tests, guest_thread_callback_abi_tests and windows_exception_tests, including their libc, libkernel and audio dependencies.
  • ctest --test-dir build --output-on-failure -R "^(guest_audio_propagation|guest_thread_callback_abi|windows_exceptions)$": 3/3 passed.
  • Private public-data synthetic fixtures through the production relinker and NID patcher: the clean current-main audio provider fails on the missing NID; the candidate binds and invokes the actual setter through its populated GOT, checks the exact named exception, descriptor-shaped sentinel preservation, null refusal and existing zero-path lifecycle behavior; an unrelated unknown NID still fails at startup. Unchanged relinker and old-provider binaries were reused from a hash-verified clean build at the same main revision.
  • python tools/check_conventions.py --base origin/main and git diff --check: passed.

A separate local SAROS trial, with a private resource mount and all 40 guest modules, exited at a later unresolved Acm import before guest initialization or ELF entry. Main-first eager import order supports that the original audio import resolved; the title never invoked this setter. That trial was not a clean run of this public candidate. No title window, rendering or gameplay was observed. Successful audio-path updates, float-register transport and gameplay remain unverified. The full test suite was not rerun.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); no silent stub added
  • No notes, investigation files, logs or images added to the repository
  • No new third-party code
  • Generic behavior, no title-specific changes
  • Depends on: none
  • AI-assisted: yes (Codex). The submitting author is responsible for every changed line.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Progress report (737e209 → 2e01ba2)

📉 System libraries: 85.71% (-0.02%, +1 declared functions)

🆕 1 declared as stubs
Library Name
libSceAudioPropagation sceAudioPropagationSourceSetAudioPath

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full diff, the public signature reference, and the regression coverage. The singular setter is declared separately from the plural API, throws through the named unsupported-function path without reading or writing caller memory, and the test checks both sentinel preservation and null refusal. The author reports Windows binding tests through the real relinker/GOT path; upstream Linux and Windows Build, Conventions, and Progress checks are green on this head. The PR clearly records that successful updates and title gameplay remain unverified. No blocking issue found.

@Dextroid17 Dextroid17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Linux — a compile-level differential, and the "does not touch caller memory" claim is genuinely pinned.

  • Arm A (this PR): guest_audio_propagation_tests builds and passes, exit 0.
  • Arm B (control): AudioPropagation.hpp and Export.cpp back at main with the test kept → the build fails to compile: GuestAudioPropagation.cpp:123: 'sceAudioPropagationSourceSetAudioPath' was not declared. So the test depends on the new declaration, which is precisely what an eager-import fix has to provide.
  • Claim cross-check: the implementation discards all three arguments (static_cast<void>) and then calls NotImplemented_nid_no_patch(__func__), so nothing reads or writes caller memory — and the test turns that into an assertion: it fills a 0xe0 buffer with 0xa5 and checks every byte is still 0xa5 after the throwing call, then repeats with a null pointer. That guarantee is the part a reader cannot see from the diff.
  • Project rule: python3 tools/pr_overlap.py --repo boykopovar/AnyPS5 --branch verify/1947 → "No overlap with open pull requests." So the TechnicalDebt.md edit does not collide with the other open PRs that touch that file.

For the merge bar: the NID (tKSmk2JsMAA) is quoted and matches TechnicalDebt's entry, but the title is only named — the FAIL: unresolved ELF import ... from libSceAudioPropagation.prx line, plus an ID, would put the evidence next to the fix. I have no dump of it to reproduce that here.

Not verified: the title's own start-up failure.

Written with AI assistance.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Which SAROS ID is this, and what's the unresolved ELF import tKSmk2JsMAA line on main? Please also drop the new test: it only checks that a not-implemented stub throws.

@Dextroid17

Copy link
Copy Markdown
Contributor

The NID half is answerable, and it resolves to the singular name this PR declares. Running the project's own oracle on the import from the body:

$ python3 tools/nid_names.py --nid tKSmk2JsMAA
NID          STATUS        SUGGESTION
tKSmk2JsMAA  rename-ready  sceAudioPropagationSourceSetAudioPath

rename-ready — the name is known and nothing implements it — which is what the PR asserts. The premise also checks out in the tree: libSceAudioPropagation declares only the plural sceAudioPropagationSourceSetAudioPaths (AudioPropagation.hpp:83, Export.cpp:285), and the singular appears nowhere on main. So an eager import of tKSmk2JsMAA does fail for the stated reason.

The other half — which SAROS title ID — cannot come out of a NID: a NID identifies a function, not a title, so that one belongs to whoever ran it.

Written with AI assistance.

@adriadam10

Copy link
Copy Markdown
Collaborator

Rebased on main (only a TechnicalDebt.md adjacency conflict) and, as asked above, dropped the new test lines from GuestAudioPropagation.cpp (they only checked that a not-implemented stub throws). The declaration, throwing export and TechnicalDebt entry are unchanged. Build and guest_audio_propagation pass on the rebased tree; NID tKSmk2JsMAA resolves to the singular name per tools/nid_names.py. Merging once CI is green.

@adriadam10
adriadam10 force-pushed the fix/audio-propagation-singular-path branch from 3adc4ff to 2e01ba2 Compare October 10, 2026 06:05
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#1934 docs/dev/TechnicalDebt.md L45
#2092 docs/dev/TechnicalDebt.md L45

@adriadam10
adriadam10 merged commit ccedc3a into boykopovar:main Oct 10, 2026
14 checks passed
SleglJan pushed a commit to SleglJan/AnyPS5 that referenced this pull request Oct 10, 2026
…tion-singular-path

fix(audio): recognize individual propagation path import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants